<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        li{
            display:flex;
            align-items:center
        }
    </style>
</head>
<body>
    <div class="box">
        <div>
            品牌：
            <select name="" id="" v-model="aaa.name">
                <option value="">所有</option>
                    <option value="大众">大众</option>
                    <option value="奔驰">奔驰</option>
                    <option value="宝马">宝马</option>
            </select>
        </div>
        <div>
            车型：
            <select name="" id="" v-model="aaa.model">
                <option value="">所有</option>
                    <option value="A1">A1</option>
                    <option value="B1">B1</option>
            </select>
        </div>
        <div>
            年份：
            <select name="" id="" v-model="aaa.age">
                <option value="">所有</option>
                    <option value="2020">2020</option>
                    <option value="2021">2021</option>
            </select>
        </div>

        <!-- <p>品牌：<input type="text" v-model="aaa.name"></p>
        <p>车型：<input type="text" v-model="aaa.model"></p>
        <p>年份：<input type="text" v-model="aaa.age"></p> -->

        <ul>
            <li v-for="(item , index) in arr" v-show="item.bool">
                <h2>
                     {{item.brand}}
                </h2>
                <span>
                    车型 {{item.series}}
                </span>
                <span>
                    年份 {{item.year}}
                </span>
            </li>
        </ul>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        new Vue({
            el:'.box',
            data:{
                aaa:{
                    name:'',
                    model:'',
                    age:'',
                },
                arr:[
                    {
                        brand:'奔驰',
                        series:'A1',
                        year:'2021',
                        bool:true,
                    },
                    {
                        brand:'奔驰',
                        series:'A1',
                        year:'2020',
                        bool:true,
                    },
                    {
                        brand:'奔驰',
                        series:'B1',
                        year:'2020',
                        bool:true,
                    },
                    {
                        brand:'奔驰',
                        series:'B1',
                        year:'2021',
                        bool:true,
                    },
                    {
                        brand:'大众',
                        series:'A1',
                        year:'2020',
                        bool:true,
                    },
                    {
                        brand:'大众',
                        series:'A1',
                        year:'2021',
                        bool:true,
                    },
                    {
                        brand:'大众',
                        series:'B1',
                        year:'2021',
                        bool:true,
                    },
                    {
                        brand:'大众',
                        series:'B1',
                        year:'2020',
                        bool:true,
                    },
                    {
                        brand:'宝马',
                        series:'A1',
                        year:'2021',
                        bool:true,
                    },
                    {
                        brand:'宝马',
                        series:'A1',
                        year:'2020',
                        bool:true,
                    },
                    {
                        brand:'宝马',
                        series:'B1',
                        year:'2020',
                        bool:true,
                    },
                    {
                        brand:'宝马',
                        series:'B1',
                        year:'2021',
                        bool:true,
                    },
                ]
            },
            watch:{
                aaa:{
                    deep:true,
                    handler(newValue , oldValue){
                        this.arr.forEach(function(item , index){
                            // 第一层
                            if(newValue.name === item.brand || newValue.name === ''){
                                item.bool = true;
                                // 第二层
                                if(newValue.model === item.series || newValue.model === ''){
                                    item.bool = true;
                                    // 第三层
                                    if(newValue.age === item.year || newValue.age === ''){
                                        item.bool = true;
                                    // 第三层
                                    }else{
                                        item.bool = false;
                                    }
                                // 第二层
                                }else{
                                    item.bool = false;
                                }
                            // 第一层
                            }else{
                                item.bool = false;
                            }
                        })
                    }
                },
            },
 

        })
    </script>
</body>
</html>